﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <script src="/js/header.js"></script>
    <link href="/lib/easyui/default/easyui.css" rel="stylesheet" />
    <script type="text/javascript" src="/lib/easyui/jquery.easyui.min.js"></script>
    <title>收款匹配查询</title>
</head>
<body style="background-color: white;">
    <section class="container-fluid" style="background-color: white;">
        <form class="form-horizontal m15_t" id="form">
            <div class="tab-content">
                <input type="hidden" id="pid" name="pid" value="0">
                <div class="tab-pane fade in active" id="home">
                    <div class="form-group">
                        <label class="wd75 control-label">备注：</label>
                        <div class="wd250 m15_l">
                            <textarea class="form-control" type="text" style="height:100px;" name="depositRemark" maxlength="50" autocomplete="off" placeholder="备注长度介于 0 和 50 之间"></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </section>

    <script src="/js/page/matchsearch.js?v=201903201544"></script>
    <script type="text/javascript">
        var id = 0;
        var orderNo = 0;

        $(function () {

            id = FlashPay.Util.GetQueryString("id");
            orderNo = FlashPay.Util.GetQueryString("orderNo");
        })

        function save() {

            var data = {
                id: id,
                orderNo: orderNo,

            };

            let depositRemark = $("textarea[name='depositRemark']").val();;
            if (depositRemark) {
                data.depositRemark = depositRemark;
            }

            ///DepositMatchRecord/ReceiptMatchRecordBindReceiptRecord?Id={0}&orderNo={1}
            FlashPay.UI.Confirm({
                content: "{0}<br>确定要<span class=red>匹配</span>该收款单？".format(id),
                ok: function () {

                    FlashPay.Util.Ajax({
                        type: "POST",
                        url: "/DepositMatchRecord/ReceiptMatchRecordBindReceiptRecord",
                        data: data,                        success: function (res) {
                            if (res.success) {

                                setTimeout(function () {
                                    FlashPay.UI.CloseDialog();
                                }, 1000);

                                FlashPay.UI.DialogOpener().closeParent(res);

                            } else {
                                FlashPay.UI.Tip_warning("删除失败：" + res.errorMessage);
                            }
                        },
                        error: function (e) {
                            FlashPay.UI.Tip_warning("网络请求失败！");
                        }
                    });

                }
            });


        }
    </script>
</body>
</html>